home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 8.8 KB | 213 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWErrors.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWERRORS_H
- #define FWERRORS_H
-
- #if defined(FW_BUILD_MAC) && !defined(__ERRORS__)
- #include <Errors.h>
- #endif
-
- #ifndef SOM_Module_OpenDoc_Errors_defined
- #include <ErrorDef.xh>
- #endif
-
- //========================================================================================
- // Type definitions
- //========================================================================================
-
- typedef long FW_PlatformError;
-
- //========================================================================================
- // Platform Error constants, to be moved to FWErrors.h
- //========================================================================================
-
- // Note that ODF always uses symbolic constants for error codes, but the physical values
- // of the error codes may vary across platforms. Wherever possible, ODF attempts to use
- // standard error codes already defined for the platform. ODF defines new error codes
- // only when no previously existing error platform error code is appropriate.
-
- // On the Macintosh, the ODF project has
- // been allocated the OSErr error code range of -30200 to -30259 (inclusive). In ODF1
- // Most symbolic error constants are defined to be based upon their Macintosh values.
- // In future releases, we may use conditional code to assign platform specific values
- // to more of the error codes. ODF developers should not rely on the specific values of
- // of any error codes
-
- const FW_PlatformError FW_xFirstODFError = -30200;
- const FW_PlatformError FW_xLastODFError = -30259;
-
- const FW_PlatformError FW_xLastUsedODFError = -30214; //FW_xInvalidPictureData
-
- // ===== FWCommon Errors =====
-
- const FW_PlatformError FW_xNoError = 0;
- // Not an error, i.e. success.
-
- const FW_PlatformError FW_xUnknownError = -30200;
- // An error occured within ODF that could not be attributed to a more specific
- // cause. ODF uses this error only when it has no other choice.
-
- // ===== FWCollec Errrors
-
- const FW_PlatformError FW_xBadInsert = -30201;
- // Error occured inserting item into a sorted array.
- // This error should only occur if the private interface to sorted array is misused.
- // The error should not happen to clients of FW_TMap<key, value>.
-
- const FW_PlatformError FW_xBadRemove = -30202;
- // Error occured removing an item from a sorted array.
-
- // ===== FWMemory Errors
-
- #if defined(FW_BUILD_MAC)
- const FW_PlatformError FW_xMemoryExhausted = memFullErr;
- #elif defined(FW_BUILD_WIN)
- const FW_PlatformError FW_xMemoryExhausted = -30999; //!!!JEL: Need correct value!!!
- #endif
-
- // ===== FWStream Errors
-
- const FW_PlatformError FW_xReadableStream = -30202;
- // An error occured while reading from a stream. Most probable cause is unexpected
- // end of sink while attemping to read a value such as a nul terminated string.
-
- const FW_PlatformError FW_xWritableStream = -30203;
- // An error occured while writing to a stream. Most probable cause is sink full.
-
- const FW_PlatformError FW_xCorruptArchiveStream = -30204;
- // An error occured while reading from a stream containing an archive of objects.
- // One likely cause is that an archivable class has not defined it's create/initialize
- // archiving functions to be consistent with it output archiving function. If, say,
- // the initialize function for a class reads too much or too little data, then the
- // stream will not be left pointing at a meaningful location, and the next attempt
- // by the archiver to read metadata will result in bad metadata.
-
- // ===== FWString Errors
-
- const FW_PlatformError FW_xStringResourceNotFound = -30205;
- // No string with the given id was found in the resource
-
- // ===== FWGraphx Errors
-
- const FW_PlatformError FW_xPrintingCanceled = -30206;
- const FW_PlatformError FW_xNoDefaultPrinter = -30207;
- const FW_PlatformError FW_xGraphicException = -30212;
- const FW_PlatformError FW_xInvalidBitmapData = -30213;
- const FW_PlatformError FW_xInvalidPictureData = -30214;
-
- // ===== FWFiles Errors
-
- const FW_PlatformError FW_xCantDeleteWorkingDirectory = -30208;
- const FW_PlatformError FW_xInvalidDirectory = -30209;
-
- #ifdef FW_BUILD_MAC
- const FW_PlatformError FW_xAFPAccessDenied = afpAccessDenied;
- const FW_PlatformError FW_xAFPDenyConflict = afpDenyConflict;
- const FW_PlatformError FW_xAFPObjectTypeErr = afpObjectTypeErr;
- const FW_PlatformError FW_xBadFileName = bdNamErr;
- const FW_PlatformError FW_xDirectoryBusy = fBsyErr;
- const FW_PlatformError FW_xDirectoryFull = dirFulErr;
- const FW_PlatformError FW_xDiskFull = dskFulErr;
- const FW_PlatformError FW_xEndOfFileReached = eofErr;
- const FW_PlatformError FW_xFileBusy = fBsyErr;
- const FW_PlatformError FW_xFileExists = dupFNErr;
- const FW_PlatformError FW_xFileLocked = fLckdErr;
- const FW_PlatformError FW_xNoFileFound = fnfErr;
- const FW_PlatformError FW_xFileNotOpen = fnOpnErr;
- const FW_PlatformError FW_xGeneralIOError = ioErr;
- const FW_PlatformError FW_xGetFPosError = gfpErr;
- const FW_PlatformError FW_xInvalidAccess = wrPermErr;
- const FW_PlatformError FW_xInvalidFileReference = rfNumErr;
- const FW_PlatformError FW_xNoSuchVolume = nsvErr;
- const FW_PlatformError FW_xNotAnHFSVolume = wrgVolTypErr;
- const FW_PlatformError FW_xParameterError = paramErr;
- const FW_PlatformError FW_xPathNotFound = dirNFErr;
- const FW_PlatformError FW_xPermissionError = permErr;
- const FW_PlatformError FW_xRenameError = fsRnErr;
- const FW_PlatformError FW_xSeekError = posErr;
- const FW_PlatformError FW_xSharingViolation = opWrErr;
- const FW_PlatformError FW_xTooManyOpenFiles = tmfoErr;
- const FW_PlatformError FW_xVolumeLocked = vLckdErr;
- const FW_PlatformError FW_xWriteProtect = wPrErr;
- #endif
-
- #ifdef FW_BUILD_WIN16
- const FW_PlatformError FW_xNoError = 0;
- const FW_PlatformError FW_xBadFileName = 123;
- const FW_PlatformError FW_xDirectoryBusy = 16;
- const FW_PlatformError FW_xDirectoryFull = 82;
- const FW_PlatformError FW_xDiskFull = 39;
- const FW_PlatformError FW_xEndOfFileReached = 38;
- const FW_PlatformError FW_xFileExists = 80;
- const FW_PlatformError FW_xFileLocked = 33;
- const FW_PlatformError FW_xNoFileFound = 2;
- const FW_PlatformError FW_xFileNotOpen = 1006;
- const FW_PlatformError FW_xGeneralIOError = 31;
- const FW_PlatformError FW_xInvalidAccess = 12;
- const FW_PlatformError FW_xInvalidFileReference = 6;
- const FW_PlatformError FW_xNoSuchVolume = 15;
- const FW_PlatformError FW_xParameterError = 87;
- const FW_PlatformError FW_xPathNotFound = 3;
- const FW_PlatformError FW_xPermissionError = 5;
- const FW_PlatformError FW_xReadFault = 30;
- const FW_PlatformError FW_xSeekError = 25;
- const FW_PlatformError FW_xSharingViolation = 32;
- const FW_PlatformError FW_xTooManyOpenFiles = 4;
- const FW_PlatformError FW_xWriteFault = 29;
- const FW_PlatformError FW_xWriteProtect = 19;
- #endif
-
- #ifdef FW_BUILD_WIN32
- const FW_PlatformError FW_xNoError = NO_ERROR;
- const FW_PlatformError FW_xBadFileName = ERROR_INVALID_NAME;
- const FW_PlatformError FW_xDirectoryBusy = ERROR_CURRENT_DIRECTORY;
- const FW_PlatformError FW_xDirectoryFull = ERROR_CANNOT_MAKE;
- const FW_PlatformError FW_xDiskFull = ERROR_HANDLE_DISK_FULL;
- const FW_PlatformError FW_xEndOfFileReached = ERROR_HANDLE_EOF;
- const FW_PlatformError FW_xFileExists = ERROR_FILE_EXISTS;
- const FW_PlatformError FW_xFileLocked = ERROR_LOCK_VIOLATION;
- const FW_PlatformError FW_xNoFileFound = ERROR_FILE_NOT_FOUND;
- const FW_PlatformError FW_xFileNotOpen = ERROR_FILE_INVALID;
- const FW_PlatformError FW_xGeneralIOError = ERROR_GEN_FAILURE;
- const FW_PlatformError FW_xInvalidAccess = ERROR_INVALID_ACCESS;
- const FW_PlatformError FW_xInvalidFileReference = ERROR_INVALID_HANDLE;
- const FW_PlatformError FW_xNoSuchVolume = ERROR_INVALID_DRIVE;
- const FW_PlatformError FW_xParameterError = ERROR_INVALID_PARAMETER;
- const FW_PlatformError FW_xPathNotFound = ERROR_PATH_NOT_FOUND;
- const FW_PlatformError FW_xPermissionError = ERROR_ACCESS_DENIED;
- const FW_PlatformError FW_xReadFault = ERROR_READ_FAULT;
- const FW_PlatformError FW_xSeekError = ERROR_SEEK;
- const FW_PlatformError FW_xSharingViolation = ERROR_SHARING_VIOLATION;
- const FW_PlatformError FW_xTooManyOpenFiles = ERROR_TOO_MANY_OPEN_FILES;
- const FW_PlatformError FW_xWriteFault = ERROR_WRITE_FAULT;
- const FW_PlatformError FW_xWriteProtect = ERROR_WRITE_PROTECT;
- #endif
-
- // ===== FWGraphics Errors
-
- #ifdef FW_BUILD_MAC
- const FW_PlatformError FW_xRegionOverflow = rgnTooBigErr;
- #else
- const FW_PlatformError FW_xRegionOverflow = -500; // !!! Need a better assignment
- #endif
-
- // ===== FWResour Errors
-
- const FW_PlatformError FW_xResourceFileNotFound = -30210;
- const FW_PlatformError FW_xResourceNotLoaded = -30211;
-
- #ifdef FW_BUILD_MAC
- const FW_PlatformError FW_xResourceNotFound = resNotFound;
- #else
- const FW_PlatformError FW_xResourceNotFound = FW_xResourceNotLoaded;// !!! Need a better assignment
- #endif
-
- #endif
-